/**
 * @Title: DemoController.java
 * @Package com.ssd.demo.module.demo.controller
 * @Description: TODOo
 * @author xiaoruihu 2016年4月22日 下午5:45:42
 * @version V1.0
 */
package com.ssd.demo.module.demo.controller;

import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ssd.demo.base.core.BaseMapper;
import com.ssd.demo.base.core.BaseService;
import com.ssd.demo.base.util.Log;
import com.ssd.demo.module.demo.entity.Demo2Entity;
import com.ssd.demo.module.demo.entity.Demo3Entity;
import com.ssd.demo.module.demo.service.DemoService;

/**
 * @Description: DemoController
 * @author xiaoruihu 2016年4月22日 下午5:45:42
 */
@Controller
@RequestMapping("demo")
public class DemoController {

    private  Logger logger = Log.get();

    private static final String PREPATH = "/demo/";
    
    /**
     * 手写的service
     */
    @Autowired
    private DemoService demoService;
    
    /**
     * 动态生成的mapper
     */
    @Autowired
    private BaseMapper<Demo2Entity> demo2Mapper;
    
    /**
     * 动态生成的service 
     */
    @Autowired
    private BaseService<Demo3Entity> demo3Service;
    

    @RequestMapping("/")
    public String demoIndex() {
        
    	logger.info(demoService.getById(1L).toString());
        logger.info(demo2Mapper.selectByPrimaryKey(1L).toString());
        logger.info(demo3Service.getById(1L).toString());
        
        logger.info("This is debug message.");
        System.out.println(5 / 0);
        return PREPATH + "index";
    }
}
